import pytest
import os
import shutil


if __name__ == '__main__':
    if os.path.exists('TestData/cache_file/images/'):
        shutil.rmtree('TestData/cache_file/images/')
        os.makedirs('TestData/cache_file/images/')
    else:
        os.makedirs('TestData/cache_file/images/')

    pytest.main(['-v', './TestCase/test_login.py::TestLogin'])

    # pytest.main(['-v', './TestCase/test_login.py::TestLogin',
    #              './TestCase/test_booksmall.py::TestMall'])

    os.system(r"allure generate ./TestData/cache_file/report -o ./TestData/cache_file/html --clean")
    os.system('allure open ./TestData/cache_file/html')


